home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / Resources / RavenDebug.r < prev    next >
Text File  |  1997-08-23  |  11KB  |  364 lines

  1. /*
  2.  *  File:       RavenDebug.r
  3.  *  Summary:       Raven resources
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996-1997 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <3>     8/05/97    JDJ        Removed 'STR#' resources.
  12.  *         <2>     7/20/97    JDJ        Added 'TxGr' resource.
  13.  *         <1>     6/30/96    JDJ        Created
  14.  */
  15.  
  16. #include <BalloonTypes.r>
  17. #include <RavenTypes.r>
  18.  
  19.  
  20. // Note that resource ids below 256 and lower case commands are reserved for Raven.
  21.  
  22. // ===================================================================================
  23. //    Menus
  24. // ===================================================================================
  25.  
  26. // menu id 128 is taken by PowerPlant
  27.  
  28. // Debug
  29. resource 'MENU' (230, "Debug") {
  30.     230, textMenuProc, allEnabled, enabled, "Debug",
  31.     {
  32.         "MACSBUG",                        noIcon, "オ",    noMark, plain,
  33.         "Enable Intense Debuggingノ",    noIcon, noKey,    noMark, plain,
  34.         "Enable Heap Checking",            noIcon, noKey,    noMark, plain,
  35.         "Ignore ASSERTs",                noIcon, noKey,    noMark, plain,
  36.         "Show SIOUX",                    noIcon, noKey,    noMark, plain,
  37.         "Show Pane Invalidations",        noIcon, noKey,    noMark, plain,
  38.         "-",                            noIcon, noKey,    noMark, plain,
  39.         "Show Memory Window",            noIcon, noKey,    noMark, plain,
  40.         "Eat Memory",                    noIcon, "",    noMark, plain,
  41.         "Purge Memory",                    noIcon, "ケ",    noMark, plain,
  42.         "Don't Free Deleted Blocks",    noIcon, noKey,    noMark, plain,
  43.         "Dump Object Heap",                noIcon, noKey,    noMark, plain,
  44.         "-",                            noIcon, noKey,    noMark, plain,
  45.         "Echo TRACEs to SIOUX",            noIcon, noKey,    noMark, plain,
  46.         "Echo TRACEs to Debug Log",        noIcon, noKey,    noMark, plain,
  47.         "Echo all TRACEFLOWs to Log",    noIcon, noKey,    noMark, plain,
  48.         "TRACEFLOW Categories",            noIcon, hierarchicalMenu, "¥0d234", plain,
  49.         "-",                            noIcon, noKey,    noMark, plain,
  50.         "Enable Monkey",                noIcon, "ツ",    noMark, plain,
  51.         "-",                            noIcon, noKey,    noMark, plain,
  52.         "Unit Tests",                    noIcon, hierarchicalMenu, "¥0d235", plain,
  53.     }
  54. };
  55.  
  56. resource 'Rcmd' (230, "Debug") { {
  57.     "macsbug",                // MACSBUG
  58.     "intense debugging",    // Enable Intense Debuggingノ
  59.     "heap check",            // Enable Heap Checking
  60.     "assert",                // Ignore ASSERTs
  61.     "show sioux",            // Show SIOUX
  62.     "show invalidations",    // Show Pane Invalidations
  63.     "nothing",                // -
  64.     "show heap",            // Show Memory Window
  65.     "eat memory",            // Eat Memory
  66.     "purge memory",            // Purge Memory
  67.     "free deleted blocks",    // Don't Free Deleted Blocks
  68.     "dump object heap",        // Dump Object Heap
  69.     "nothing",                // -
  70.     "trace to sioux",        // Echo TRACEs to SIOUX
  71.     "trace to file",        // Echo TRACEs to File
  72.     "trace all to file",    // Echo all TRACEFLOWs to File
  73.     "traceflow",            // TRACEFLOW Categories
  74.     "nothing",                // -
  75.     "monkey",                // Enable Monkey
  76.     "nothing",                // -
  77.     "unit tests",            // Unit Tests
  78. } };
  79.  
  80.  
  81. resource 'hmnu' (230, "Debug", purgeable) {
  82.     HelpMgrVersion,
  83.     hmDefaultOptions,
  84.     0, 0,
  85.     
  86.     // Default menu item text 
  87.     HMSkipItem {
  88.         // no missing items
  89.     },
  90.     
  91.     {    
  92.         // Debug menu title
  93.         HMStringItem {
  94.             "Use this menu to help debug your application.",            // Enabled 
  95.             "",                                                            // Disabled 
  96.             "This menu's not available; respond to the dialog box.",    // Disabled by dialog box 
  97.             "This command's not available; respond to the dialog box.",    // Menus items disabled by dialog box 
  98.         },
  99.         
  100.         // MACSBUG
  101.         HMStringItem {
  102.             "Drops you into MACSBUG.",                                    // Enabled 
  103.             "",                                                            // Disabled 
  104.             "",                                                            // Checked 
  105.             "",                                                            // Marked 
  106.         },
  107.                     
  108.         // Enable Intense Debuggingノ
  109.         HMStringItem {
  110.             "Enables and disables extra debugging code.",                // Enabled 
  111.             "",                                                            // Disabled 
  112.             "",                                                            // Checked 
  113.             "",                                                            // Marked 
  114.         },
  115.                     
  116.         // Enable Heap Checking
  117.         HMStringItem {
  118.             "Enables and disables checking the object heap before every call to operator new.",    // Enabled 
  119.             "Enables and disables checking the object heap before every call to operator new."
  120.             "Disabled because leak checking is off.",                    // Disabled 
  121.             "",                                                            // Checked 
  122.             "",                                                            // Marked 
  123.         },
  124.                     
  125.         // Ignore ASSERTs
  126.         HMStringItem {
  127.             "Enables and disables dropping into the debugger when an ASSERT fires.",    // Enabled 
  128.             "",                                                            // Disabled 
  129.             "",                                                            // Checked 
  130.             "",                                                            // Marked 
  131.         },
  132.                     
  133.         // Show SIOUX
  134.         HMStringItem {
  135.             "Shows and hides the SIOIX window.",                        // Enabled 
  136.             "Shows and hides the SIOIX window. Not available because the SIOUX window "
  137.             "hasn't been constructed (i.e. nothing has been written to SIOUX yet).",                                                            // Disabled 
  138.             "",                                                            // Checked 
  139.             "",                                                            // Marked 
  140.         },
  141.                     
  142.         // Show Pane Invalidations
  143.         HMStringItem {
  144.             "Toggles a delay after a pane is drawn.",                        // Enabled 
  145.             "",                                                            // Disabled 
  146.             "",                                                            // Checked 
  147.             "",                                                            // Marked 
  148.         },
  149.                     
  150.         // -
  151.         HMSkipItem {
  152.         },
  153.                     
  154.         // Show Memory Window
  155.         HMStringItem {
  156.             "Shows or hides a window showing information about the app, temp, system, and object heaps.",    // Enabled 
  157.             "",                                                            // Disabled 
  158.             "",                                                            // Checked 
  159.             "",                                                            // Marked 
  160.         },
  161.                     
  162.         // Eat Memory
  163.         HMStringItem {
  164.             "Gobbles up 10% of the free memory. Note that this memory is never released.",    // Enabled 
  165.             "",                                                            // Disabled 
  166.             "",                                                            // Checked 
  167.             "",                                                            // Marked 
  168.         },
  169.                     
  170.         // Purge Memory
  171.         HMStringItem {
  172.             "Purges all purgeable handles.",                            // Enabled 
  173.             "",                                                            // Disabled 
  174.             "",                                                            // Checked 
  175.             "",                                                            // Marked 
  176.         },
  177.                     
  178.         // Don't Free Deleted Blocks
  179.         HMStringItem {
  180.             "Enables and disables freeing deleted blocks (this can be useful if you "
  181.             "suspect the memory is being used after being deleted since it prevents "
  182.             "another object from reusing that memory).",                // Enabled 
  183.             "",                                                            // Disabled 
  184.             "",                                                            // Checked 
  185.             "",                                                            // Marked 
  186.         },
  187.                     
  188.         // Dump Object Heap
  189.         HMStringItem {
  190.             "Dumps a bunch of information about the object heap to SIOUX.",    // Enabled 
  191.             "",                                                            // Disabled 
  192.             "",                                                            // Checked 
  193.             "",                                                            // Marked 
  194.         },
  195.                     
  196.         // -
  197.         HMSkipItem {
  198.         },
  199.                     
  200.         // Echo TRACEs to SIOUX
  201.         HMStringItem {
  202.             "Causes TRACEs and TRACEFLOWs to go to SIOUX.",                // Enabled 
  203.             "",                                                            // Disabled 
  204.             "Prevents TRACEs and TRACEFLOWs from going to SIOUX.",        // Checked 
  205.             "",                                                            // Marked 
  206.         },
  207.                     
  208.         // Echo TRACEs to File
  209.         HMStringItem {
  210.             "Causes TRACEs and TRACEFLOWs to go to SIOUX.",                // Enabled 
  211.             "",                                                            // Disabled 
  212.             "Prevents TRACEs and TRACEFLOWs from going to SIOUX.",        // Checked 
  213.             "",                                                            // Marked 
  214.         },
  215.                     
  216.         // Echo all TRACEFLOWs to File
  217.         HMStringItem {
  218.             "Causes TRACEs and all TRACEFLOWs to go to a log file.",    // Enabled 
  219.             "",                                                            // Disabled 
  220.             "Prevents disabled TRACEFLOWs from going to a log file.",    // Checked 
  221.             "",                                                            // Marked 
  222.         },
  223.                     
  224.         // TRACEFLOW Categories
  225.         HMSkipItem {
  226.         },
  227.                     
  228.         // -
  229.         HMSkipItem {
  230.         },
  231.                     
  232.         // Enable Monkey
  233.         HMStringItem {
  234.             "Creates a monkey that acts as (a real stupid) virtual user.",    // Enabled 
  235.             "Creates a monkey that acts as (a real stupid) virtual user. "
  236.             "Not available because the monkey isn't implemented yet.",        // Disabled 
  237.             "",                                                            // Checked 
  238.             "",                                                            // Marked 
  239.         },
  240.                     
  241.         // -
  242.         HMSkipItem {
  243.         },
  244.                     
  245.         // Unit Tests
  246.         HMSkipItem {
  247.         },                    
  248.     }
  249. };
  250.  
  251.  
  252. // TRACEFLOW Categories
  253. resource 'MENU' (234, "TRACEFLOW Categories") {
  254.     234, textMenuProc, allEnabled, enabled, "TRACEFLOW Categories",
  255.     {
  256.     }
  257. };
  258.  
  259. resource 'Rcmd' (234, "TRACEFLOW Categories") { {
  260. } };
  261.  
  262. resource 'hmnu' (234, "TRACEFLOW Categories", purgeable) {
  263.     HelpMgrVersion,
  264.     hmDefaultOptions,
  265.     0, 0,
  266.     
  267.     // Default menu item text 
  268.     HMStringItem {
  269.         "Enables and disables a TRACEFLOW category.",                        // Enabled 
  270.         "",                                                                    // Disabled 
  271.         "",                                                                    // Checked 
  272.         "",                                                                    // Marked 
  273.     },
  274.     
  275.     {    // TRACEFLOW Categories menu title 
  276.         HMStringItem {
  277.             "Use this menu to enable and disable TRACEFLOW categories.",    // Enabled 
  278.             "",                                                                // Disabled 
  279.             "This menu's not available; respond to the dialog box.",        // Disabled by dialog box 
  280.             "This command's not available; respond to the dialog box.",        // Menus items disabled by dialog box 
  281.         },
  282.     }
  283. };
  284.  
  285.  
  286. // Units Tests
  287. resource 'MENU' (235, "Unit Tests") {
  288.     235, textMenuProc, allEnabled, enabled, "Unit Tests",
  289.     {
  290.         "Test Everything",            noIcon, noKey,    noMark, plain,
  291.     }
  292. };
  293.  
  294. resource 'Rcmd' (235, "Unit Tests") { {
  295.     "do every unit test",    // Test Everything
  296. } };
  297.  
  298. resource 'hmnu' (235, "Unit Tests", purgeable) {
  299.     HelpMgrVersion,
  300.     hmDefaultOptions,
  301.     0, 0,
  302.     
  303.     // Default menu item text 
  304.     HMStringItem {
  305.         "Executes a function that tests a Raven or app class.",                // Enabled 
  306.         "",                                                                    // Disabled 
  307.         "",                                                                    // Checked 
  308.         "",                                                                    // Marked 
  309.     },
  310.     
  311.     {    // Unit Tests menu title 
  312.         HMStringItem {
  313.             "Use this menu to test some of Raven's classes. "
  314.             "Note that you can create unit tests for your application classes "
  315.             "see ZUnitTest.h for details.",                                    // Enabled 
  316.             "",                                                                // Disabled 
  317.             "This menu's not available; respond to the dialog box.",        // Disabled by dialog box 
  318.             "This command's not available; respond to the dialog box.",        // Menus items disabled by dialog box 
  319.         },
  320.     }
  321. };
  322.  
  323. resource 'MENU' (236, "Memory Window Context Menu") {
  324.     236, textMenuProc, allEnabled, enabled, "Memory Window Context Menu",
  325.     {
  326.         "Show Application",    noIcon, noKey,    noMark, plain,
  327.         "Show Temporary",    noIcon, noKey,    noMark, plain,
  328.         "Show System",        noIcon, noKey,    noMark, plain,
  329.         "Show Object",        noIcon, noKey,    noMark, plain,
  330.     }
  331. };
  332.  
  333. resource 'Rcmd' (236, "Memory Window Context Menu") { {
  334.     "toggle application",    // Show Application
  335.     "toggle temporary",        // Show Temporary
  336.     "toggle system",        // Show System
  337.     "toggle object",        // Show Object
  338. } };
  339.  
  340. // menu id's 250-252 are taken by PowerPlant
  341.  
  342.  
  343. // ===================================================================================
  344. //    Strings
  345. // ===================================================================================
  346.  
  347. // STR# id's 150-153, 200 are taken by PowerPlant
  348.  
  349. // ===================================================================================
  350. //    Lexer Grammer Resource (used by Parser unit test)
  351. // ===================================================================================
  352.  
  353. resource 'TxGr' (128, "Expression Grammer") { {
  354.     '#', "[0-9]+",
  355.     0, "",
  356.     
  357.     '+', "+",
  358.     '-', "-",
  359.     '*', "*",
  360.     '/', "/",
  361.     '(', "(",
  362.     ')', ")",
  363. } };
  364.